
%{
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>

char * outdir;
FILE * file;
long int filecount=0;
char filename[14];
%}

BEGINDOC "<DOC>"


DOCID "<DOCID.valor="

%%

{BEGINDOC} {
	sprintf(filename,"%s%ld.tag",(outdir)?outdir:"./",
							filecount++);
	if(yyout != stdin)
		fclose(yyout);
	yyout= fopen(filename,"w");
	fputs(yytext,yyout);
}


%
